package com.xymtop.api.utils;


import java.text.SimpleDateFormat;

public class Timer {

    /**
    *@Description:获取unix时间戳
    *@Parameter:[]
    *@Return:java.lang.Long
    *@Author:肖叶茂
    *@Date:2022/12/1
    **/
    public static  Long getTimeStamp(){
        return  System.currentTimeMillis();
    }

    /**
    *@Description:通过linux时间戳来获取常规的时间
    *@Parameter:[TimeStamp]
    *@Return:java.lang.String
    *@Author:肖叶茂
    *@Date:2022/12/1
    **/
    public  static  String getSmapleTime(Long TimeStamp){
        SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //设置格式
        String timeString = timeFormat.format(TimeStamp);
        return  timeString;
    }
}
